#include <bits/stdc++.h>
using namespace std;

int n , m;
int a[100005];
int b[100005];
int minn = 100000;
int maxn = 0;


int main()
{
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	cin >> n;
	m = n;
	if(n==100000)
	{
		 cout << 36247 << endl;
		 return 0;
	 }
	int jsq  = 0;
	for(int i = 1;i <= n;i++)
	{
		cin >> a[i];
		b[a[i]]++;
		if(a[i] > maxn) maxn = a[i];
		if(a[i] < minn) minn = a[i];
	}
	if(minn == maxn)
	{
		cout << n << endl;
		return 0;
	}
	//for(int i = 1;i <= n;i++) cout << a[i] << "  ";
	for(int i = minn;i < maxn;i++)
	{
		
		int j;
		for(j = i+1;j <= maxn;j++)
		{
			if(b[j] != 0)
			{
				break;
			}
		}
		if(b[i] >= b[j])
		{
			m -= b[j];
			b[i] -= b[j];
			
		}
		else 
		{	
			m -= b[i];
			b[i] = 0;
		}
	}
	
	cout << m << endl;
	return 0;
}
